﻿Imports System
Imports System.Threading

Namespace $RootNamespace$
     Public NotInheritable Class $MultiThreadedSingleton$
        ' Methods
        Private Sub New()
        End Sub

        Public Shared Sub Test()
            $MultiThreadedSingleton$.Instance.Operation()
        End Sub

        Public Sub Operation()
            Console.WriteLine("in $MultiThreadedSingleton$'s Operation()")
        End Sub


        ' Properties
        Public Shared ReadOnly Property Instance() As $MultiThreadedSingleton$
            Get
                Return _instance.Value
            End Get
        End Property


        ' Fields
	Private Shared ReadOnly _instance As New Lazy(Of $MultiThreadedSingleton$)(Function() New $MultiThreadedSingleton$(),LazyThreadSafetyMode.PublicationOnly)

    End Class


End Namespace
